export const USER_KEY = 'users';
export const CURRENT_KEY = 'currentUser';
// 用户信息
export const getUsers = () => JSON.parse(localStorage.getItem(USER_KEY) || '{}');
export const setUsers = (users) => localStorage.setItem(USER_KEY, JSON.stringify(users));
export const setCurrent = (username) => localStorage.setItem(CURRENT_KEY, username);
export const getCurrent = () => localStorage.getItem(CURRENT_KEY);
export const clearCurrent = () => localStorage.removeItem(CURRENT_KEY);
// 用户任务
export const getTasks = (username) => JSON.parse(localStorage.getItem(`tasks_${username}`) || '[]');
export const setTasks = (username, tasks) => localStorage.setItem(`tasks_${username}`, JSON.stringify(tasks));
